<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript">
function save(){
    	   $.ajax({
  			type:'post',
  			url:'${pageContext.request.contextPath }/plupmodule/updatemodelbase',
  		    dataType: "json",
  		    data:$("#form").serialize(),
  		    async: false,
  			success:function(data){//返回json结果
      			var addstate=data.model.flag;
      			if(addstate==0){
      				alert("修改失败");
      			}else{
      				alert("修改成功");
      				//window.location.href="${pageContext.request.contextPath }/plupmodule/modulelist";
          			}
  			}
  			
  		});
  	 
         }
</script>

</head>
<body>
<form class="form-horizontal" role="form" id="form" name="form"  method="post">
 <c:if test="${viewState==0}">
                   <div class="form-group">
                           <label class="col-xs-1 control-label" for="ds_host">模块名称</label>
                          <div class="col-xs-4">
                           <input class="form-control" id="module_id" name="module_id"  value="${moduleEntity.module_id}" type="hidden" /> 
                             <input class="input-sm form-control" name="module_name" id="module_name" type="text" value="${moduleEntity.module_name}"/>
                          </div>
                          <label class="col-xs-1 control-label" for="ds_name">模块首页</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" name="module_index_page_id" id="module_index_page_id" type="text" value="${moduleEntity.module_index_page_id}"/>
                          </div>
							 <div class="col-xs-1">
							 <c:if test="${viewState==0}">
								<button type="button" class="btn btn-default" onclick="save()">&nbsp;&nbsp;保存&nbsp;&nbsp;</button>
							</c:if>
							<c:if test="${viewState==1}">
								<button type="button" class="btn btn-default" onclick="history.go(-1)">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>
							</c:if>
							</div>                             
                       </div>
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="ds_username">模块描述</label>
                          <div class="col-xs-9">
                             <textarea class="input-sm form-control" rows="3" name="long_desc" id="long_desc"  >${moduleEntity.long_desc}</textarea>
                          </div>                       
                       </div>
                       </c:if>
                       <c:if test="${viewState==1}">
                   <div class="form-group">
                           <label class="col-xs-1 control-label" for="ds_host">模块名称</label>
                          <div class="col-xs-4">
                           <input class="form-control" id="module_id" name="module_id" readonly="readonly" value="${moduleEntity.module_id}" type="hidden" /> 
                             <input class="input-sm form-control" name="module_name" readonly="readonly" id="module_name" type="text" value="${moduleEntity.module_name}"/>
                          </div>
                          <label class="col-xs-1 control-label" for="ds_name">模块首页</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" name="module_index_page_id" readonly="readonly" id="module_index_page_id" type="text" value="${moduleEntity.module_index_page_id}"/>
                          </div>
							 <div class="col-xs-1">
								<button type="button" class="btn btn-default" onclick="history.go(-1)">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>
							</div>                             
                       </div>
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="ds_username">模块描述</label>
                          <div class="col-xs-9">
                             <textarea class="input-sm form-control" rows="3" readonly="readonly" name="long_desc" id="long_desc"  >${moduleEntity.long_desc}</textarea>
                          </div>                       
                       </div>
                       </c:if>
                </form>
	</div>
	</div>
</body>

</html>
